/*
 * Copyright(C) 2021. Huawei Technologies Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <map>
#include <memory>
#include "MxBase/E2eInfer/Image/Image.h"
#include "MxBase/E2eInfer/Model/Model.h"
#define FRAME_LENGTH 30
#define KEY_POINTS 14
#define SKELETON_CENTER 2

using keyPointsT = struct keyPoints {
    float point_x;
    float point_y;
    int num;
};

using connectionT = struct connection {
    int point_1;
    int point_2;
    float score;
};

using EngineTransNewT = struct EngineTransNew {
    float data[1][SKELETON_CENTER][FRAME_LENGTH][KEY_POINTS];
    uint32_t bufferSize;
};

/**
* ClassifyProcess
*/
class GestureDetectV2 {
public:
    GestureDetectV2();
    ~GestureDetectV2();
    APP_ERROR Postprocess(MxBase::Image& image, std::vector<MxBase::Tensor>& modelOutput, std::shared_ptr<EngineTransNewT> motion_data_new, int &success_num);
    APP_ERROR PostGestureProcess(std::vector<MxBase::Tensor>& modelOutput);
};

